<?php
/*
Plugin Name: PersonalInfo
Plugin URI: http://www.yhustc.com/
Description: 个人信息
Author: yhustc
Version: 1.0
Author URI: http://www.yhustc.com/
*/

class PersonalInfoWidget extends Widget
{
	function render($data=array())
	{
		$metaInfo = S("metaInfo");
		if(!$metaInfo)
		{
			$usermetaDao = D("Usermeta");
			$metaInfo = $usermetaDao->find(); 
			//暂时先这样,因为是单用户
			//如果要处理多用户版,需要能从URL上判断出取哪个用户的meta信息
			S("metaInfo",$metaInfo);
		}
		
		$user_picture = empty($metaInfo["user_picture"])?WEB_PUBLIC_URL."/Images/noface.gif":Input::forTag($metaInfo["user_picture"]);

		$this->assign("user_picture",$user_picture);
		$this->assign("metaInfo",$metaInfo);
		return $this->renderFile();
	}
}
?>